
/**
 * Class to hold a search property type and value.
 *
 */
public class SearchProperty
{	
	private Type type;
	private String value;
	
	public static enum Type
	{
		ARTIST,
		ALBUM,
		DATE,
		GENRE,
		TITLE;
	}
	
	public static String getSearchPropertyName(Type type)
	{
		switch (type)
		{
			case ARTIST: return "upnp:artist";
			case ALBUM: return "upnp:album";
			case DATE: return "dc:date";
			case GENRE: return "upnp:genre";
			case TITLE: return "dc:title";
			default: throw new IllegalArgumentException("Invalid Search Property");
		}
		
	}
	
	public SearchProperty(Type type)
	{
		this(type, null);
	}
	
	public SearchProperty(Type type, String value)
	{
		this.type = type;
		this.value = value;
	}

	public Type getType()
	{
		return type;
	}

	public void setType(Type type)
	{
		this.type = type;
	}

	public String getValue()
	{
		return value;
	}

	public void setValue(String value)
	{
		this.value = value;
	}
}
